import numpy as np
import cv2 as cv 
import matplotlib.pyplot as plt
#图像嵌在jupyter Notebook 网页中当前cell下显示
# %matplotlib inline


#从当前目录下img 下子目录引入一张彩色图像
img = cv.imread('./img/1.jpg',cv.IMREAD_COLOR)
imgRGB = img[:,:,::-1]      #将图像颜色通道顺序调整为RGB
#也可以采用Opencv的颜色空间转换函数
#imgRGB=cv.cvtColor(img,cv.COLOR_BGR2RGB)
plt.figure()    #make window
plt.imshow(img) #show BGR img
plt.title('Color image in BGR')

plt.figure()    #make window
plt.imshow(imgRGB) #show BGR img
plt.title('Color image in RGB')#图像标题
plt.show()